.optimization-view {
  width: 100%;
}

.optimization-view .ant-card {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* SQL对比视图样式 */
.sql-comparison-card {
  margin-bottom: 16px;
}

.sql-comparison-card .ant-card-body {
  padding: 16px;
}

.unified-diff-view {
  width: 100%;
}

.sql-before,
.sql-after {
  height: 100%;
}

.sql-before .ant-typography-title,
.sql-after .ant-typography-title {
  margin-bottom: 12px;
  font-size: 14px;
  color: #666;
}

.sql-before {
  border-right: 1px solid #f0f0f0;
  padding-right: 8px;
}

.sql-after {
  padding-left: 8px;
}

/* 语法高亮容器 */
.optimization-view .react-syntax-highlighter {
  border-radius: 6px !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

/* 优化详情表格样式 */
.optimization-view .ant-table-small {
  font-size: 12px;
}

.optimization-view .ant-table-thead > tr > th {
  background: #fafafa;
  font-weight: 600;
  font-size: 12px;
  padding: 8px 12px;
}

.optimization-view .ant-table-tbody > tr > td {
  padding: 8px 12px;
  vertical-align: top;
}

/* 代码块样式 */
.optimization-view .ant-typography code {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 11px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 优化类型标签样式 */
.optimization-view .type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* 影响程度标签样式 */
.optimization-view .impact-high {
  background: #fff1f0;
  border-color: #ffa39e;
  color: #cf1322;
}

.optimization-view .impact-medium {
  background: #fffbe6;
  border-color: #ffe58f;
  color: #d48806;
}

.optimization-view .impact-low {
  background: #f6ffed;
  border-color: #b7eb8f;
  color: #389e0d;
}

/* 置信度徽章样式 */
.optimization-view .confidence-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 0 6px;
  border-radius: 10px;
}

.optimization-view .confidence-high {
  background: #f6ffed;
  color: #389e0d;
  border: 1px solid #b7eb8f;
}

.optimization-view .confidence-medium {
  background: #fffbe6;
  color: #d48806;
  border: 1px solid #ffe58f;
}

.optimization-view .confidence-low {
  background: #fff1f0;
  color: #cf1322;
  border: 1px solid #ffa39e;
}

/* 工具栏样式 */
.optimization-view .toolbar {
  background: #fafafa;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.optimization-view .toolbar .ant-btn-group .ant-btn {
  border-radius: 0;
}

.optimization-view .toolbar .ant-btn-group .ant-btn:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.optimization-view .toolbar .ant-btn-group .ant-btn:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* 统计卡片样式 */
.optimization-view .stats-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.optimization-view .stats-card .ant-card-body {
  padding: 12px 16px;
}

.optimization-view .stats-card .ant-typography {
  color: white;
}

.optimization-view .stats-card .ant-badge-count {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* 选择开关样式 */
.optimization-view .selection-switch {
  margin: 0;
}

.optimization-view .ant-switch-small {
  min-width: 28px;
  height: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .optimization-view .sql-before {
    border-right: none;
    padding-right: 0;
    margin-bottom: 16px;
  }
  
  .optimization-view .sql-after {
    padding-left: 0;
  }
  
  .optimization-view .ant-card-body {
    padding: 12px;
  }
  
  .optimization-view .toolbar {
    padding: 8px 12px;
  }
  
  .optimization-view .ant-table-small .ant-table-thead > tr > th,
  .optimization-view .ant-table-small .ant-table-tbody > tr > td {
    padding: 6px 8px;
  }
}

/* 加载和空状态 */
.optimization-view .loading-container,
.optimization-view .empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #666;
}

.optimization-view .empty-container .anticon {
  font-size: 48px;
  margin-bottom: 16px;
  color: #d9d9d9;
}

/* 动画效果 */
.optimization-view .ant-card {
  transition: all 0.3s ease;
}

.optimization-view .ant-btn {
  transition: all 0.2s ease;
}

.optimization-view .ant-btn:hover {
  transform: translateY(-1px);
}

/* 差异高亮样式 */
.optimization-view .diff-addition {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
}

.optimization-view .diff-deletion {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}

.optimization-view .diff-modification {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}